package c.main.core;

import c.main.util.WebUtils;
import com.mchange.v2.c3p0.ComboPooledDataSource;
import sun.org.mozilla.javascript.internal.ast.NewExpression;

import javax.sql.DataSource;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * Author: chengwei
 * Date:   2016/3/16
 * Time:   9:37
 */
public class WcsProperties {
    private String impl_package;
    public void load() {
        WcsContext wcsContext = new WcsContext();
        DataSource ds = new ComboPooledDataSource();
        wcsContext.setDataSource(WebUtils.DEFAULT_DATA_SOURCE,ds);
        C.setContext(wcsContext);
        Properties p = new Properties();
        try {
            InputStream input = this.getClass().getClassLoader().getResourceAsStream("wcs.properties");
            p.load(input);
            this.impl_package = p.getProperty("sys_impl_package");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public String getImpl_package() {
        return impl_package;
    }
    
}
